-- card: 7977 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 7765 -- name: Experiment 2 ----- HyperTalk script ----- on runExperiment global timeIncrement2,rotIncrement2 global wheelSpeed,wheelRadius global cardClear2 put 176 into centerLine put 0 into theta put 0 into timeElapsed put "0," & 176-round(wheelRadius) into oldPoint put oldPoint into newPoint put false into cardClear2 hide menubar choose line tool set the lineSize to 2 put "Click the mouse to stop." into field "Blurb" repeat until the mouse is down put round((wheelSpeed*timeElapsed)+(wheelRadius*sin(theta))) into item 1 of newPoint -- x-coordinate put round(centerLine-(wheelRadius*cos(theta))) into item 2 of newPoint -- y-coordinate if item 1 of newPoint > 412 then exit repeat drag from oldPoint to newPoint put newPoint into oldPoint put timeElapsed+timeIncrement2 into timeElapsed put theta+rotIncrement2 into theta end repeat choose browse tool show menubar put "Click on this field to restore the screen." into field "Blurb" end runExperiment -- part 2 (field) -- low flags: 81 -- high flags: 2004 -- rect: left=11 top=40 right=326 bottom=403 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: Help -- part 5 (button) -- low flags: 00 -- high flags: A002 -- rect: left=16 top=319 right=340 bottom=76 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Return ----- HyperTalk script ----- on mouseUp global ReturnCard go ReturnCard end mouseUp -- part contents for background part 1 ----- text ----- Press this field to begin tracing the path of the pen. -- part contents for card part 2 ----- text ----- This experiment deals with a pen mounted at the edge of a wheel which is mounted on top of a cart that is moving to the right at a constant velocity. the wheel rotates at a velocity independent of the speed of the cart and on an axis perpendicular to the direction of motion of the cart (i.e. straight out from the screen). The pen traces its path on a piece of clear plastic as it passes. This card simulates that experiment. It will compute and draw the path of the pen based on the parameters you can set by clicking on the "Set Parameters" button in the control panel.